]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
StThemeNodeTransition: work around Cogl bug
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 23 Sep 2010 14:04:44 +0000 (10:04 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 23 Sep 2010 16:44:07 +0000 (12:44 -0400)
Switch to using the layer combine constant rather than the material
primary color for representing the opacity of the material; this
avoids triggering a Cogl bug where changing the primary color corrupts
the layer state.

https://bugzilla.gnome.org/show_bug.cgi?id=629616

src/st/st-theme-node-transition.c

index 319cea7c336699138823442c6847bc0e606112bb..3a3eaf2cc75628739e09d321b3c62f5823955223 100644 (file)
@@ -263,7 +263,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
                                            NULL);
           cogl_material_set_layer_combine (material_template, 2,
                                            "RGBA = MODULATE (PREVIOUS, "
-                                                            "PRIMARY)",
+                                                            "CONSTANT)",
                                            NULL);
         }
       priv->material = cogl_material_copy (material_template);
@@ -322,9 +322,10 @@ st_theme_node_transition_paint (StThemeNodeTransition *transition,
                           clutter_alpha_get_alpha (priv->alpha));
   cogl_material_set_layer_combine_constant (priv->material, 1, &constant);
 
-  cogl_material_set_color4ub (priv->material,
-                              paint_opacity, paint_opacity,
-                              paint_opacity, paint_opacity);
+  cogl_color_set_from_4ub (&constant,
+                           paint_opacity, paint_opacity,
+                           paint_opacity, paint_opacity);
+  cogl_material_set_layer_combine_constant (priv->material, 2, &constant);
 
   cogl_set_source (priv->material);
   cogl_rectangle_with_multitexture_coords (priv->offscreen_box.x1,